from sqlalchemy import (
    Column,
    String,
    Text,
)
from ..database import Base, IsoDateTime
from datetime import datetime
from utils.id_util import generate_id
from constants import CrimeStatus

class CrimeModel(Base):
    __tablename__ = "crimes"

    id = Column(String, primary_key=True, default=generate_id, index=True)
    title = Column(String, index=True)
    description = Column(Text)
    location = Column(String)
    crime_type = Column(String, index=True)
    severity = Column(String)
    status = Column(String, default=CrimeStatus.OPEN)
    created_at = Column(IsoDateTime, default=datetime.now)
    updated_at = Column(IsoDateTime, default=datetime.now, onupdate=datetime.now)

    